![]() |
PATH![]() |
All JManager API calls reference an instantiation of the Java runtime environment called a session or a JMSessionRef object. This section describes routines that create and dispose of a Java runtime session.
Instantiates a Java runtime session and returns a session pointer.
OSStatus JMOpenSession (
JMSessionRef* session,
JMRuntimeOptions runtimeOptions,
JMVerifierOptions verifyMode,
const JMSessionCallbacks* callbacks,
JMTextEncoding desiredEncoding,
JMClientData data);
A valid session pointer has a value other than null . If not enough system memory exists to instantiate a session, JMOpenSession returns memFullErr .
Beginning a Java Runtime Session.
The
JMCloseSession
function.
Ends a Java runtime session and removes the allocated JMSessionRef object.
OSStatus JMCloseSession (JMSessionRef session);
A successful call to JMCloseSession also frees any resources allocated by JManager. However, any resources that you explicitly allocated on behalf of JManager (such as AWT contexts or applets) must be explicitly removed before calling JMCloseSession .
The
JMOpenSession
function.
Allows JManager time to service other threads.
OSStatus JMIdle (JMSessionRef session,
UInt32 JMTimeMillis);
If no threads need to be serviced, JMIdle returns immediately. JMIdle also returns, suspending other threads, if a user event occurs in the current session. You should call the JMIdle function once each time through the event loop.
The
JMFrameMouseOver
function.
Gets the proxy information for a given session.
OSStatus JMGetProxyInfo (
JMSessionRef session,
JMProxyType type,
JMProxyInfo* proxyInfo);
JMSetProxyInfo
functionSets the proxy information for an existing session.
OSStatus JMSetProxyInfo (
JMSessionRef session,
JMProxyType type,
const JMProxyInfo* proxyInfo);
The
JMGetProxyInfo
function
Gets the state of the code verifier for an existing session.
OSStatus JMGetVerifyMode (
JMSessionRef session,
JMVerifierOptions* verifierOptions);
The code verifier checks to see that the Java code is valid and that it does not attempt any illegal actions that could affect the host platform. You set the code verifier either when instantiating the session (using the
JMOpenSession
function
JMOpenSession
) or by calling the
JMSetVerifyMode
function
JMSetVerifyMode
.
Sets the code verifier mode for an existing session.
OSStatus JMSetVerifyMode (JMSessionRef session,
JMVerifierOptions verifierOptions);
The verifier checks to see that the Java code is valid and that it does not attempt any illegal actions that could affect the host platform. You can also set the verifier mode when calling the
JMOpenSession
function
JMOpenSession
.
The
JMGetVerifyMode
function .
Obtains client data for an existing session.
OSStatus JMGetSessionData (
JMSessionRef session,
JMClientData* data);
JMSetSessionData
function.
Sets client data for an existing session.
OSStatus JMSetSessionData (
JMSessionRef session,
JMClientData data);
JMGetSessionData
functionObtains a property value for an existing session.
OSStatus JMGetSessionProperty (
JMSessionRef session,
const JMTextRef propertyName,
JMTextRef* propertyValue;
The
JMPutSessionProperty
function.
Adds or modifies a session property.
OSStatus JMPutSessionProperty (
JMSessionRef session,
const JMTextRef propertyName,
const JMTextRef propertyValue);
If the property does not exist, JManager creates a new one with the name in propertyName and the value in propertyValue . This function corresponds to the Java method java.lang.System.setProperty .
The
JMGetSessionProperty
function.
Obtains a JNI reference for an existing session
extern jobject JMGetSessionJNIObject (
JMSessionRef session,
JNIEnv * env);
The JMGetSessionJNIObject
returns the JNI reference equivalent (of type
jobject
) of the
JMSessionRef
reference.
Obtains a JRI reference for an existing session.
jref JMGetSessionObject (JMSessionRef session);
The JMGetSessionObject
returns the JRI reference equivalent (of type
jref
) of the
JMSessionRef
reference.
Note that unless you specifically need to use the Java Runtime Interface (JRI), you should use the
JMGetSessionJNIObject
function instead.